public class Test2 {
    public static boolean fun(char c) {
        if((c >='a'&& c<='z' ) || ( c>= 'A'&& c<= 'Z')){
            return true;
        }
        return false;
    }

    public static void main(String[] args) {
        String str = new String("Hello,my name is xiaoli");
        int count = 1;
        for (int i = 0; i < str.length(); i++) {
            if(!fun(str.charAt(i))){
                count++;
            }
        }
        System.out.println(count);
    }
}
